#ifndef __NEURON_H__
#define __NEURON_H__

#include "std_def.h"
#include "axon.h"
#include "synapse.h"
#include "neuron_calc.h"

class neuron
{
public:
  neuron(const int);
  neuron(const neuron&);
  neuron();
  virtual ~neuron();

  neuron& operator=(const neuron& val);

  void setCalcFunction(neuron_calc *);

  synapse &getSynapse(ntype::synapseid_t) const;
  bool setSynapse(const synapse&, ntype::synapseid_t);

  axon &getAxon(void);
  const axon &getAxon(void) const;
  void setAxon(const axon&);

  double calc(void);
  void calc_back(void);
  double calc_study(void);
  void calc_back_study(void);

  ntype::weight_t clac_back_synapse_w(ntype::synapseid_t);

  void setActivTiling(double);
  double getActivTiling();

  void setSynapseCount(ntype::synapsecount_t);
  ntype::synapsecount_t getSynapseCount() const;

  void setStudyBufferIndex(ntype::signalid_t);

  void setNeuronID(ntype::neuronid_t);
  ntype::neuronid_t getNeuronID() const;

  ntype::signalid_t getMaxSignalStudyBufferIndex() const;

  ntype::error_t getAxonStudyError();
  void setStudyNeuronError(ntype::error_t);
  ntype::error_t getStudyNeuronError() const;

protected:
  double                   activ_tiling;  //параметр наклона сигмоидальной функции
  synapse                 *_psynapse;
  ntype::synapsecount_t    synapse_count;
  axon                     _axon;
  neuron_calc             *_pcalcfunc;
  ntype::signalid_t        study_buffer_index;
  ntype::neuronid_t        neuron_id;
  ntype::error_t           neuron_study_error;

};


#endif
